﻿CREATE VIEW [steve].[uvSteve_UrlRewriteLatest]
	AS 
	
SELECT r.UrlRewriteId
	, r.SiteName
	, r.Url
	, r.LatestRevisionNumber
	, r.CreateDate
	, r.ExternalId
	, r.SystemName
	, r.CreateMembershipId
	, rr.StartDate
	, rr.SiteUrlId
	, rr.RewriteOrder
	, rr.RevisionMembershipId
	, rr.RevisionDate
	, rr.RevisionComment
	, rr.PassQueryString
	, rr.IsSecure
	, rr.IgnoreQueryString
	, rr.EndDate
FROM steve.UrlRewrite r
	inner join steve.UrlRewriteRevision rr on r.UrlRewriteId = rr.UrlRewriteId and r.LatestRevisionNumber = rr.RevisionNumber
